feat: support external ca from cloud-integrator #330
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
This PR partially is in tandem with the PR canonical/grafana-cloud-integrator#21 and should be merged after.
It also fixes (partially) canonical/grafana-cloud-integrator#18 (I'm also opening a PR in the machine charm).
cloud_config_requirer
library.Solution
grafana-cloud-integrator#21 (the PR for the CA issue) is addressed by saving the CA coming from relation data to file, and then calling
update-ca-certificates
as usual. We do this on the customcloud-config-available
event, which is emitted whenever there is a relation joined/changed/broken involving the cloud-integrator relation.grafana-cloud-integrator#18 (the config issue) is solved by populating the
_loki_config
not only if there are endpoints coming fromself._loki_consumer
, but also considering the ones coming from the cloud integrator (self._cloud.loki_ready
). The endpoints themselves are already included inself._loki_endpoints_with_tls()
.Testing Instructions
Remember to use the Loki FQDN, not the IP, or TLS won't work.
# all the juju deploy commands are from edge and with --trust juju deploy (the grafana-agent-k8s charm from this branch) agent juju deploy (the grafana-cloud-integrator from the linked PR) cloud-integrator juju deploy self-signed-certificates ca juju deploy flog-k8s flog juju deploy loki-k8s loki
juju config cloud-integrator loki-url="https://<loki-fqdn>:3100/loki/api/v1/push"
agent
series in Loki (no CA is configured in cloud-integrator yet)